#!/bin/bash
#安装docker
curl -sSL https://get.daocloud.io/docker | sh
#安装gitlab
docker run --detach \
  --hostname code.study36.top \
  --env GITLAB_OMNIBUS_CONFIG="external_url 'http://code.study36.top/'; gitlab_rails['lfs_enabled'] = true;" \
  --publish 444:443 --publish 81:80 --publish 23:22 \
  --name gitlab \
  --restart always \
  --volume /opt/gitlab/config:/etc/gitlab \
  --volume /opt/gitlab//logs:/var/log/gitlab \
  --volume /opt/gitlab//data:/var/opt/gitlab \
  gitlab/gitlab-ee:latest
docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
#安装openresty
wget https://openresty.org/download/openresty-1.19.3.2.tar.gz
apt-get install libpcre3-dev \
    libssl-dev perl make build-essential curl
tar -xzvf openresty-1.19.3.2.tar.gz
cd ./openresty-1.19.3.2
make -j2 && make install
ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx
#安装docker仓库
 docker run -d \
  -p 5000:5000 \
  --restart=always \
  --name registry \
  -v /opt/registry:/var/lib/registry \
  registry:2